package com.jill.jianghu.actions;

import org.apache.log4j.Logger;
import org.apache.struts2.convention.annotation.Result;
import org.apache.struts2.convention.annotation.Results;

import com.jill.jianghu.bean.base.Emploee;
import com.jill.jianghu.util.action.BackCommonActionSupport;

@Results(value={
		@Result(name="input", location="user.jsp"),
		@Result(name="success", location="user.jsp")
})
public class UserAction extends BackCommonActionSupport {

	private static final long serialVersionUID = 1L;
	protected static final Logger LOG = Logger.getLogger(UserAction.class);
	
	private String name;
	private Emploee empl;
	
	/* (non-Javadoc)
	 * @see org.apache.struts2.rest.RestActionSupport#index()
	 */
	public String index() {
		LOG.debug("UserAction.index()");
		this.name = "index name";
		System.out.println(this.name);
		return SUCCESS;
	}

	/* (non-Javadoc)
	 * @see com.opensymphony.xwork2.ActionSupport#execute()
	 */
	@Override
	public String execute() {
		LOG.debug("UserAction.execute()");
		this.name = "execute name";
		System.out.println(this.name);
		return SUCCESS;
	}
	
	/* (non-Javadoc)
	 * @see com.jill.jianghu.util.action.CommonActionSupport#create()
	 */
	public String create(){
		LOG.debug("UserAction.create()");
		if(this.empl == null){
			return INPUT;
		}else{
			System.out.println(this.empl.getTruename());
			System.out.println(this.empl.getRegister_time());
			return SUCCESS;
		}
	}
	
	
	/**
	 * @param name the name to set
	 */
	public void setName(final String name) {
		this.name = name;
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}


	/**
	 * @param empl the empl to set
	 */
	public void setEmpl(final Emploee empl) {
		this.empl = empl;
	}


	/**
	 * @return the empl
	 */
	public Emploee getEmpl() {
		return empl;
	}
}
